const {
  getCategoryCourseList
} = require('../../../api/api.js');
const pageMixin = require('../../../mixin/pageMixin.js');
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  mixins: [pageMixin],
  data: {
    imgHost: '',
    loadMethod: getCategoryCourseList,
    loadOptions: {
      currentType: 0,
      typeKey: 'category'
    },
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.setData({
      imgHost: app.img_host
    })
    const CATEGORY_ID = app.id;
    this.data.loadOptions.currentType = CATEGORY_ID;
    this.loadData();
  },
  onReachBottom() {
    this.bottomLoading().catch((e) => {
      console.log(e)
    })
  }
  /**
   * 至课程列表页
   */
})